package com.dingreading.cloud.subject.service.impl;

import com.dingreading.cloud.subject.dto.SubjectLessonVideoDto;
import com.dingreading.cloud.subject.entity.SubjectLessonVideo;
import com.dingreading.cloud.subject.entity.table.SubjectLessonVideoTableDef;
import com.dingreading.cloud.subject.mapper.SubjectLessonVideoMapper;
import com.dingreading.cloud.subject.service.SubjectLessonVideoService;
import com.mybatisflex.core.query.QueryWrapper;
import org.springframework.stereotype.Service;

/**
 * 服务层实现。
 *
 * @author Administrator
 * @since 2025-10-13
 */
@Service
public class SubjectLessonVideoServiceImpl extends BaseServiceImpl<SubjectLessonVideoMapper, SubjectLessonVideo, SubjectLessonVideoTableDef> implements SubjectLessonVideoService {

    @Override
    protected SubjectLessonVideoTableDef getTable() {
        return SubjectLessonVideoTableDef.subjectLessonVideo;
    }

    @Override
    public SubjectLessonVideoDto dtoByUid(String videoUid) {
        QueryWrapper wrapper = QueryWrapper.create()
                .where(table.uid.eq(videoUid));
        return getMapper().selectOneByQueryAs(wrapper, SubjectLessonVideoDto.class);
    }
}
